<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/jquery.min.js"></script>
    <script src="./js//template-web.js"></script>

    <style>
        *{
            margin: 0;
            padding: 0;
        }
        table{
            width:550px;
            height:280px;
            margin: 0 auto;
            text-align: center;
            border-collapse:collapse;
        }
       td{
           border:1px solid;
           
       }
    </style>
</head>
<body>

     <table>
         <tbody id="tbody">

         </tbody>
     </table>

    <script id="tmp" type="text/html">

        {{each forecast}}
           <tr>
           <td>{{$value.date}}</td>
           <td>{{$value.fengxiang}}</td>
           <td>{{$value.high}}</td>
           <td>{{$value.low}}</td>
           <td>{{$value.tianqi}}</td>
           <td>edit</td>
           </tr>

        {{/each}}

    </script>


      <script>
        //   function getData(){
        //     $.ajax({
        //         url:'http://fronttest2.our360vr.com/test.json',
        //         type:'get',
        //         success:function(res){
        //             console.log(res)
        //             var html=template('tmp',res.data)
        //             console.log(html)
        //             $('#tbody').html(html)
        //         },
        //         error:function(){
                     
        //         }
        //    })
        //   }
        //   getData()

        function getData(){
            $.ajax({
                url:'http://fronttest2.our360vr.com/test.json',
                type:'get',
                success:function(res){
                    console.log(res)
                    var html=template('tmp',res.data)
                    console.log(html)
                    $('#tbody').html(html)
                }

            })
        }

        getData()
         
      </script>
</body>
</html>